<?php

	include("../common/connect.php");
	$username=$_GET['username'];
	$password=$_GET['password'];
	
	$query="select * from users where username='$username' and password='$password'";
	//echo $query." ".$radio." ".($radio=="qianjiang");
 	$result = mysql_query($query) or die("Query failed");
	$rows_sum=0;
	$rows_sum=@mysql_num_rows($result);
	session_start();
	// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less
	if (!isset($_SESSION['count'])) {
	    $_SESSION['count'] = 1;
	} else {
	    $_SESSION['count']++;
	}
	
	if ($rows_sum == 0) {
		echo "username password is not correct!";
		return;
	}
	$data=@mysql_fetch_array($result);
	$userid=$data['ID'];
	
	$_SESSION['username']=$username;
	$_SESSION['userid']=$userid;
	//echo $_SESSION['userid'];
	echo "<script language='Javascript'>";        
	echo "window.location = \"../wanna/frame.php\";";
    echo "</script>";
	
	
?>